package com.cordys.opensource.crom;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

import com.cordys.cpc.bsf.busobject.BusObject;

/**
 * This annotation must be used by objects that need to be persisted in the database.
 * The framework will listen to any CRUD operations on those objects and do the appropriate actions on the database.
 * @see BusObjectMetadata
 * @see DomainObjectEventListener
 * @see RevisionedObject
 */
@Retention(RetentionPolicy.RUNTIME)
public @interface DomainObject
{
	/**
	 * Returns the WS-AppServer database class that has to be used to persist the DomainObject.
	 * E.g., for the crom.example.domain.User domain object, this returns crom.example.db.Person
	 * If a value is not specified, then a db class will be searched based on the class name of the DomainObject inside the db package.
	 */
	Class<? extends BusObject> table() default BusObject.class;
}
